Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for UNIV and RF mTCA EVR models #63

Merged

Conversation

ZanMaticPratnemer
Copy link
Contributor

So far only IFB model is supported. This pull request adds support for UNIV and RF models. If no model is selected, the default one is picked (IFB).

@ZanMaticPratnemer ZanMaticPratnemer marked this pull request as draft October 7, 2022 07:37
@ZanMaticPratnemer ZanMaticPratnemer marked this pull request as ready for review October 7, 2022 11:24
,mult(f==formFactor_CPCIFULL ? 40 : 20) // CML word length
,wordlen(f==formFactor_CPCIFULL ? 2 : 1)// # of 32-bit dwords used to store 1 CML word
// 40 bits fit in 2 dwords, 20 bits fit in 1
// CML word length
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was already solved in the commit 1e82b86

@jerzyjamroz jerzyjamroz self-assigned this Oct 10, 2023
@jerzyjamroz jerzyjamroz marked this pull request as draft October 10, 2023 08:43
@jerzyjamroz
Copy link
Contributor

Hi, the initial conversation took place: #89

@jerzyjamroz
Copy link
Contributor

jerzyjamroz commented Oct 11, 2023

I)

The issue I found was related to the way we use CLKA/B within the mTCA-EVR-300U MTCA backplane (the patch was in our internal repo). @ZanMaticPratnemer, please check: #94 . We deleted lines 288-292, you actually modified those in your PR. Then the .substitution config looks like: #95 and it works fine. Tested over a few years already. Could you confirm if this solution works for you?

@ZanMaticPratnemer
Copy link
Contributor Author

Hi, the modification of those lines were purely visual on my end, possibly even automated by my formatter. So yeah that works for me, maybe @zioven has some other comments.

@jerzyjamroz
Copy link
Contributor

II)

mTCA-EVR-300

mTCA-EVR-300 with IFP is discontinued and the code in line: https://github.com/epics-modules/mrfioc2/pull/63/files#diff-ec09296cb3ed989142d2d3a7eeb1fda890d403e91250f9328befd76e01fc5217R215
actually refers to a generic MTCA EVR, we have been using it for mTCA-EVR-300U and mTCA-EVR-300 (IFP) together as we have some obsolete IFP units (the FPGA images are the same, but we do not use IFP socket at all).

Your Implementation

Your implementation is cleaner so my proposal is to go for it accordingly:

mtca_evr_model variable

@zioven
Copy link
Contributor

zioven commented Oct 12, 2023

@jerzyjamroz
As @ZanMaticPratnemer has mentioned I have inherited this task and pull request from him.

Regarding I): I will be testing this with our setup and determine how the changes to TCLKA and TCLKB work on our system

Regarding II): I can rebase the changes to the master (provide a new pull request) and we can open up the discussion what is best approach and where we see the challenges/improvements.

@jerzyjamroz jerzyjamroz linked an issue Oct 12, 2023 that may be closed by this pull request
@jerzyjamroz jerzyjamroz linked an issue Oct 13, 2023 that may be closed by this pull request
@zioven zioven force-pushed the mtca-rf-and-mtca-univ branch from 2d49873 to 34076cd Compare December 6, 2023 11:31
@zioven zioven force-pushed the mtca-rf-and-mtca-univ branch from 34076cd to cd22577 Compare December 15, 2023 10:16
@zioven
Copy link
Contributor

zioven commented Dec 15, 2023

@jerzyjamroz , @mdavidsaver

I have rebased the pull request to the latest master.

In the last commit, I have updated both 300U and 300RF substitutions file, so that they are backwards compatible:

  • with the current version of the GUIs
  • for any existing installation, that has used the default naming convention with { }

Please review and comment.

@jerzyjamroz jerzyjamroz force-pushed the mtca-rf-and-mtca-univ branch from cd22577 to 02ae593 Compare December 15, 2023 13:29
ZanMaticPratnemer and others added 8 commits December 15, 2023 14:35
All MTCA EVRs have the CML/GTX outputs for TCLKA and TCLKB
mapped to Universal Output 16 and 17 (chapters 3.7. and 3.8.) and
CML/GTX logic block 0 and 1.

mTCA-EVR-300RF has additional high resolution outputs mapped as:
- UNIV2  : mapped to Universal Output 18 and CML/GTX logic block 2
- UNIV3  : mapped to Universal Output 19 and CML/GTX logic block 3
- GTX SFP: mapped to Universal Output 20 and CML/GTX logic block 4
- +-CML  : mapped to Universal Output 21 and CML/GTX logic block 5
@jerzyjamroz jerzyjamroz force-pushed the mtca-rf-and-mtca-univ branch from 02ae593 to 4c5f21f Compare December 15, 2023 13:35
@jerzyjamroz jerzyjamroz marked this pull request as ready for review December 15, 2023 13:38
@jerzyjamroz jerzyjamroz self-requested a review as a code owner December 15, 2023 13:38
@jerzyjamroz
Copy link
Contributor

@zioven I only wonder why CLKA/B works fine for mtca-evr-300u without this:

        for (unsigned int i = 16; i <= 17; ++i) {
            outputs[std::make_pair(OutputFPUniv, i)]
                = new MRMOutput(SB() << n << ":FrontUnivOut" << i, this, OutputFPUniv, i);
        }

What was not working for you that you decided to add it?

@zioven
Copy link
Contributor

zioven commented Dec 15, 2023

I had reports of missing objects evrN:FrontUnivOutX for TCLKA and TCLKB similar to this:

smpl{evrN-Out:FP0}Src-RB_: failed to find/create object 'evr2:FrontOut0' : Object not found : evr2:FrontOut0  
smpl{evrN-Out:FP0}Src2-RB_: failed to find/create object 'evr2:FrontOut0' : Object not found : evr2:FrontOut0 
smpl{evrN-Out:FP1}Src-RB_: failed to find/create object 'evr2:FrontOut1' : Object not found : evr2:FrontOut1  
smpl{evrN-Out:FP1}Src2-RB_: failed to find/create object 'evr2:FrontOut1' : Object not found : evr2:FrontOut1 
smpl{evrN-Out:FP2}Src-RB_: failed to find/create object 'evr2:FrontOut2' : Object not found : evr2:FrontOut2  
smpl{evrN-Out:FP2}Src2-RB_: failed to find/create object 'evr2:FrontOut2' : Object not found : evr2:FrontOut2 
smpl{evrN-Out:FP3}Src-RB_: failed to find/create object 'evr2:FrontOut3' : Object not found : evr2:FrontOut3  
smpl{evrN-Out:FP3}Src2-RB_: failed to find/create object 'evr2:FrontOut3' : Object not found : evr2:FrontOut3 

NOTE: Errors above occurred when I loaded the evr-mtca-300u.db while initializing for mTCA-EVR-300RF card, which does not have any permanent Front Outputs.

@jerzyjamroz
Copy link
Contributor

jerzyjamroz commented Dec 15, 2023

I use the actual master this moment and the objects are fine:

Object: EVR:FrontOut0
Type: 9MRMOutput
Object: EVR:FrontOut1
Type: 9MRMOutput
Object: EVR:FrontOut2
Type: 9MRMOutput
Object: EVR:FrontOut3
Type: 9MRMOutput

@zioven , try this file: evr-mtca-300.db, maybe your setup has some dependencies on some special characters.

@zioven
Copy link
Contributor

zioven commented Dec 18, 2023

@jerzyjamroz
The message above is just an example of the missing objects that I got for my mTCA-EVR-300U card.
If I didn't create the FrontUnivOut objects for TCLKA and TCLKB outputs, I got a similar error.

According to Jukka's document, TCLKA and TCLKB outputs are mapped as following:

  • TCLKA : Universal Output 16
  • TCLKB : Universal Output 17

In current config (see code reference below), the number of FPUV Outputs is set to 18 (assuming this is the IFB version of EVR, 16 on the interface box + 2 which correspond to TCLKA and TCLKB)

static const EVRMRM::Config mtca_evr_300 = {
"mTCA-EVR-300",
16, // pulse generators
8, // prescalers
4, // FP outputs
18, // Univ outputs (16 via external IFB + 2 handled specially)
10, // RB outputs (10 EVRTM)
8, // Backplane outputs
2, // FP Delay outputs
0, // CML/GTX outputs
MRMCML::typeTG300,
/**
* 0 <= N <= 3 : FPInMap
* 4 <= N <= 23 : UnivInMap
* 24 <= N <= 31 : BPInMap
* 48 - 57 : TBInMap (EVRTM)
*/
58, // FP, Univ, BP, TB inputs
};

With the addition of the mTCA-EVR-300U and mTCA-EVR-300RF the number of FPUV Outputs is less than that.

  • in case of mTCA-EVR-300U: 4
  • in case of mTCA-EVR-300RF*: 2

In my opinion it doesn't make sense to create 18 objects, from which only 6 or 4 shall be used.

Based on this conclusion, I have added a separate creation of objects (for TLCKA and TCLKB) for FrontUnivOut16, FrontUnivOut17 on all platforms, and reduced the number of FPUV modules on generic mtca_evr_300 configuration to 16 (as is the actual number of Front Universal Outputs).

mTCA-EVR-300RF* details

(additional 2 on the front panel , that are GTX and linked to `Universal Output 18` and `Universal Output 19` are also created separately)

@jerzyjamroz
Copy link
Contributor

jerzyjamroz commented Dec 27, 2023

@zioven , I got your point, you are right it is a cleaner solution.

I just noticed that you found the reverse solution for the .substitution implementation. I was just thinking of adding more .substitution files if needed e.g.

  • .substitution - old naming,
  • .uv.substitution - universal naming.

but both implementations can be used.

@jerzyjamroz jerzyjamroz merged commit b66485f into epics-modules:master Dec 27, 2023
11 checks passed
@zioven zioven deleted the mtca-rf-and-mtca-univ branch January 4, 2024 10:50
jerzyjamroz pushed a commit to jerzyjamroz/mrfioc2 that referenced this pull request Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

To align handling of the GTX outputs and #63 PR. Add support for MTCA EVR 300U and 300RF
3 participants